Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.

set up new release tooling for controller/sidecar subrepos #97

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

BlaineEXE
Copy link
Contributor

Set up new cloudbuild tooling for the controller/sidecar subrepo layout.

Controller and sidecar are both always built pushed to staging with the current git tag (e.g., v20240905-v0.1.0-58-g80979e8) as well as 'latest'.

Controller pre-release staging build can be initiated by creating a github release (or tag) in the form cloudbuild/TAG.

Similarly, sidecar pre-release staging build can be initiated by creating a github release (or tag) in the form sidecar/TAG.

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 10, 2024
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 10, 2024
@BlaineEXE
Copy link
Contributor Author

I think this is ready, but I want to test at least the basics of this locally in the gcr.io/k8s-testimages/gcb-docker-gcloud:v20240718-5ef92b5c36 image.

@BlaineEXE BlaineEXE marked this pull request as ready for review September 10, 2024 18:17
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 10, 2024
@BlaineEXE
Copy link
Contributor Author

I've done the best testing I can do of this at the current moment. Once monorepo is merged to master, the cloudbuild jobs set up for sig-storage projects will start working.

The cloudbuild is only initiated for master, release-*, and semver tags: https://github.com/kubernetes/test-infra/blob/7422cc54466be151982954c115d03d3413045fe3/config/jobs/image-pushing/k8s-staging-sig-storage.yaml#L701-L709

This config comes from a template script, so I think we'll just have to wait. Nothing will be pushed to a release repo without manual action, so it should be safe.

@BlaineEXE
Copy link
Contributor Author

Instead of a make target, I opted for hack/cloudbuild.sh. The cloudbuild environment is pretty particular just for cloudbuild, and it doesn't make sense to me to make a make target for it. A build-and-release make target would imply some kind of support, and it seems best to me if we leave it up to any downstream builders to tailor their tooling for their unique environment. In my experience, downstream builders usually roll their own anyway, sometimes making use of make primitives, which we are doing for cloudbuild using make build.

Set up new cloudbuild tooling for the controller/sidecar subrepo layout.

Controller and sidecar are both always built pushed to staging  with the
current git tag (e.g., v20240905-v0.1.0-58-g80979e8) as well as 'latest'.

Controller pre-release staging build can be initiated by creating a
github release (or tag) in the form `cloudbuild/TAG`.

Similarly, sidecar pre-release staging build can be initiated by creating
a github release (or tag) in the form `sidecar/TAG`.

Signed-off-by: Blaine Gardner <[email protected]>
substitutions:
# K8s provides custom substitutions _GIT_TAG and _PULL_BASE_REF:
# https://github.com/kubernetes/test-infra/blob/master/config/jobs/image-pushing/README.md#custom-substitutions
_GIT_TAG: '12345' # e.g., vYYYYMMDD-hash, vYYYYMMDD-tag, or vYYYYMMDD-tag-n-ghash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just leave it as an empty string?

Copy link
Contributor Author

@BlaineEXE BlaineEXE Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is copy-pasted from the previous cloudbuild files -- copy-pasted from an example that I found in some docs. I don't know exactly why, but IIRC it was in the example file as well, so it seemed like it might have some use for testing/validation.

export CONTROLLER_TAG="${CONTROLLER_IMAGE}:${GIT_TAG}"

# build in parallel
make --jobs --output-sync build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any benefit for multiprocessing here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my local testing, this increases the build speed, but it isn't significant. Maybe a 20-30% improvement. I am also testing on macos where the linux native tools don't run as efficiently. It would be hard to guess whether the improvement on the linux build environments would be more or less impactful.

Copy link
Contributor

@shanduur shanduur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 27, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BlaineEXE, shanduur

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit bec5d8e into kubernetes-retired:monorepo Sep 27, 2024
4 checks passed
@BlaineEXE BlaineEXE deleted the cloudbuild branch October 3, 2024 17:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants